import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Layout from '@/layout/index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    redirect: '/home',
    children: [
      {
        path: '/home',
        name: 'Home',
        component: Home
      },
      {
        path: '/classify',
        name: 'Classify',
        component: () => import('../views/classify.vue')
      },
      {
        path: '/my',
        name: 'My',
        component: () => import('../views/my.vue')
      },
      {
        path: '/shoppingcard',
        name: 'Shoppingcard',
        component: () => ('../views/shoppingcard.vue')
      },
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/login.vue')
  }, 
]

const router = new VueRouter({
  routes
})

export default router
